]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Add small gnome-shell-extension-prefs script
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 27 Apr 2020 19:57:33 +0000 (21:57 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 27 Apr 2020 22:06:19 +0000 (00:06 +0200)
Commit d76162c1c047c removed the ability to pass an extension UUID to
the Extensions app, when we moved the dialog to a portal and made
gnome-shell use it instead of spawning the extensions app.

However that missed that many extensions called out to the app to
open their own prefs.

While extensions are encouraged to switch to the new openPrefs()
convenience method added in commit 8030d9ad323e, restore the old
behavior with a small script under the old gnome-shell-extension-prefs
name that either calls out to the portal or launches the app.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1220

.gitignore
src/gnome-shell-extension-prefs [new file with mode: 0755]
src/meson.build

index 38d6765cc95aeef446632537110d5b48d01931cd..396a628e51a6267bed607695eae3fea2c0a90aac 100644 (file)
@@ -60,7 +60,6 @@ src/calendar-server/evolution-calendar.desktop
 src/calendar-server/org.gnome.Shell.CalendarServer.service
 src/gnome-shell
 src/gnome-shell-calendar-server
-src/gnome-shell-extension-prefs
 src/gnome-shell-extension-tool
 src/gnome-shell-hotplug-sniffer
 src/gnome-shell-perf-helper
diff --git a/src/gnome-shell-extension-prefs b/src/gnome-shell-extension-prefs
new file mode 100755 (executable)
index 0000000..303b196
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+openPrefs() {
+  if [ "$(which gnome-extensions)" ]
+  then
+    gnome-extensions prefs $1
+  else
+    gdbus call --session \
+      --dest=org.gnome.Shell.Extensions \
+      --object-path=/org/gnome/Shell/Extensions \
+      --method=org.gnome.Shell.Extensions.OpenExtensionPrefs $1 '' '{}'
+  fi
+}
+
+cat >&2 <<EOT
+gnome-shell-extension-prefs is deprecated
+
+Install https://flathub.org/apps/details/org.gnome.Extensions for extension
+management, or use the gnome-extensions command line tool.
+
+Extensions can use the ExtensionUtils.openPrefs() method.
+EOT
+
+UUID=$1
+
+if [ "$UUID" ]
+then
+  openPrefs $UUID
+else
+  gapplication launch org.gnome.Extensions
+fi
index 46680d5b42ab0cc3f85f5782811f362fe2914e91..546d3a64b58cd70b1ac9052ec1dedb349b3a9f05 100644 (file)
@@ -31,6 +31,10 @@ foreach tool : script_tools
   )
 endforeach
 
+install_data('gnome-shell-extension-prefs',
+  install_dir: bindir
+)
+
 gnome_shell_cflags = [
   '-DCLUTTER_ENABLE_EXPERIMENTAL_API',
   '-DCOGL_ENABLE_EXPERIMENTAL_API',